<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_users', function (Blueprint $table) {
            $table->id()->comment('ID');
            $table->string('username', 40)->unique()->comment('用户名');
            $table->string('nickname', 40)->unique()->comment('昵称');
            $table->string('password', 60)->comment('密码');
            $table->string('avatar', 100)->nullable()->comment('头像');
            $table->boolean('gender')->default(0)->comment('性别 0:未知 1:男性 2:女性');
            $table->string('email', 100)->nullable()->comment('邮箱');
            $table->char('mobile', 11)->unique()->comment('手机号');
            $table->boolean('status')->default(1)->comment('状态 1:启用 2:禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_users');
    }
}
